import {
    createWriteStream
} from 'fs';
import {
    join
} from 'path';
import { EventEmitter } from 'events';

const target = join(process.cwd(),'a.txt')
const stream = createWriteStream(target)
// write，finsh error
console.log(stream instanceof EventEmitter);
// 自定义事件 流程，模仿的就是 EventEmitter